﻿//-----------------------------------------------------------------------------------------
// <copyright file="TVOut.cs" company="Jakub Florczyk (www.jakubflorczyk.pl)">
//      Copyright © 2009 Jakub Florczyk (www.jakubflorczyk.pl)
//      http://samsungmobilesdknet.codeplex.com
// </copyright>
//-----------------------------------------------------------------------------------------

namespace SamsungMobileSDKNET
{
    using System.Runtime.InteropServices;

    /// <summary>
    /// TV Out contrast levels.
    /// </summary>
    public enum TVOutContrast
    {
        /// <summary>
        /// Low contrast.
        /// </summary>
        Low,

        /// <summary>
        /// Medium contrast.
        /// </summary>
        Medium,

        /// <summary>
        /// High contrast.
        /// </summary>
        High
    }

    /// <summary>
    /// TV Out brightness levels.
    /// </summary>
    public enum TVOutBrightness
    {
        /// <summary>
        /// Low brightness.
        /// </summary>
        Low,

        /// <summary>
        /// Medium brightness.
        /// </summary>
        Medium,

        /// <summary>
        /// High brightness.
        /// </summary>
        High
    }

    /// <summary>
    /// TV Out video quality.
    /// </summary>
    public enum TVOutVideoQuality
    {
        /// <summary>
        /// Soft video.
        /// </summary>
        Soft,

        /// <summary>
        /// Natural video.
        /// </summary>
        Natural,

        /// <summary>
        /// Sharp video.
        /// </summary>
        Sharp
    }

    /// <summary>
    /// Samsung TV Out API.
    /// </summary>
    /// <remarks>
    /// The TV Out API controls video output provided by a phone's analog video signal connector.  The interface allows the application to change brightness, contrast, and video quality.
    /// <br/><br/>
    /// The specific features of the TV Out values vary from device to device.
    /// <br/>
    /// These are not specified by the Samsung TV Out API. Please refer to device-specific documentation for these details.
    /// </remarks>
    public class TVOut
    {
        /// <summary>
        /// Gets the device's current contrast level.
        /// </summary>
        /// <param name="contrast">Pointer to the contrast level of the device.</param>
        /// <returns>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.Success"/> on success
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorInvalidParameter"/> if the input parameter is NULL
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorDeviceNotFound"/> if the device is not present or supported
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorUnknown"/> for all other failures
        /// </returns>
        [DllImport(Common.DllName, EntryPoint = "SmiTVOutGetContrast")]
        public static extern ResultCode GetContrast(
            [Out] out TVOutContrast contrast);

        /// <summary>
        /// Sets the device's contrast level.
        /// </summary>
        /// <param name="contrast">Contrast level of the device.</param>
        /// <returns>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.Success"/> on success
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorInvalidParameter"/> if the input parameter is invalid
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorDeviceNotFound"/> if the device is not present or supported
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorUnknown"/> for all other failures
        /// </returns>
        [DllImport(Common.DllName, EntryPoint = "SmiTVOutSetContrast")]
        public static extern ResultCode SetContrast(
            [In] TVOutContrast contrast);

        /// <summary>
        /// Gets the device's current brightness level.
        /// </summary>
        /// <param name="brightness">Pointer to the brightness level of the device.</param>
        /// <returns>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.Success"/> on success
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorInvalidParameter"/> if the input parameter is NULL
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorDeviceNotFound"/> if the device is not present or supported
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorUnknown"/> for all other failures
        /// </returns>
        [DllImport(Common.DllName, EntryPoint = "SmiTVOutGetBrightness")]
        public static extern ResultCode GetBrightness(
            [Out] out TVOutBrightness brightness);

        /// <summary>
        /// Sets the device's brightness level.
        /// </summary>
        /// <param name="brightness">Brightness level of the device.</param>
        /// <returns>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.Success"/> on success
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorInvalidParameter"/> if the input parameter is invalid
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorDeviceNotFound"/> if the device is not present or supported
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorUnknown"/> for all other failures
        /// </returns>
        [DllImport(Common.DllName, EntryPoint = "SmiTVOutSetBrightness")]
        public static extern ResultCode SetBrightness(
            [In] TVOutBrightness brightness);

        /// <summary>
        /// Gets the device's current video quality.
        /// </summary>
        /// <param name="quality">Pointer to the video quality of the device.</param>
        /// <returns>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.Success"/> on success
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorInvalidParameter"/> if the input parameter is NULL
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorDeviceNotFound"/> if the device is not present or supported
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorUnknown"/> for all other failures
        /// </returns>
        [DllImport(Common.DllName, EntryPoint = "SmiTVOutGetVideoQuality")]
        public static extern ResultCode GetVideoQuality(
            [Out] out TVOutVideoQuality quality);

        /// <summary>
        /// Sets the device's video quality.
        /// </summary>
        /// <param name="quality">Video quality level of the device.</param>
        /// <returns>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.Success"/> on success
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorInvalidParameter"/> if the input parameter is invalid
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorDeviceNotFound"/> if the device is not present or supported
        /// <br/>
        /// <see cref="F:SamsungMobileSDKNET.ResultCode.ErrorUnknown"/> for all other failures
        /// </returns>
        [DllImport(Common.DllName, EntryPoint = "SmiTVOutSetVideoQuality")]
        public static extern ResultCode SetVideoQuality(
            [In] TVOutVideoQuality quality);
    }
}
